package com.yjt.javatest.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yjt.javatest.entity.DTO.QuestionTestDTO;
import com.yjt.javatest.entity.QuestionTestLib;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface QuestionTestLibMapper extends BaseMapper<QuestionTestLib> {
    @Select("select coalesce(max(`order`),0) from question_test_lib where test_lib_id = #{testLibId}")
    Long getMaxOrderByTestLibId(Long testLibId);
    @Select("select question_id, `order`, score from question_test_lib where test_lib_id = #{testLibId}")
    List<QuestionTestDTO> getQuestionsByTestLibId(Long testLibId);
}
